<% layout('/layouts/default.html', {title: '硬件信息管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('硬件信息管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('rt:rtDeviceHardware:edit')){ %>
					<a href="${ctx}/rt/rtDeviceHardware/form" class="btn btn-default btnTool" title="${text('新增硬件信息')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${rtDeviceHardware}" action="${ctx}/rt/rtDeviceHardware/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('设备ID')}：</label>
					<div class="control-inline">
						<#form:input path="deviceId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('总容量')}：</label>
					<div class="control-inline">
						<#form:input path="xtTotal" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('已使用容量')}：</label>
					<div class="control-inline">
						<#form:input path="xtUsed" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('磁盘名称')}：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('读延迟')}：</label>
					<div class="control-inline">
						<#form:input path="rawait" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('负载率')}：</label>
					<div class="control-inline">
						<#form:input path="ioutil" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('写延迟')}：</label>
					<div class="control-inline">
						<#form:input path="wawait" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('数据上报日期')}：</label>
					<div class="control-inline">
						<#form:input path="reportTime" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('磁盘序列号')}：</label>
					<div class="control-inline">
						<#form:input path="serial" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('是否为加速版 ')}：</label>
					<div class="control-inline">
						<#form:input path="isCache" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('磁盘类型')}：</label>
					<div class="control-inline">
						<#form:radio path="type" dictType="" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('磁盘温度')}：</label>
					<div class="control-inline">
						<#form:input path="temperature" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('磁盘总大小')}：</label>
					<div class="control-inline">
						<#form:input path="total" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('磁盘使用量')}：</label>
					<div class="control-inline">
						<#form:input path="used" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('每秒读')}：</label>
					<div class="control-inline">
						<#form:input path="ips" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('每秒写')}：</label>
					<div class="control-inline">
						<#form:input path="ops" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('核数')}：</label>
					<div class="control-inline">
						<#form:input path="memTotal" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('内存')}：</label>
					<div class="control-inline">
						<#form:input path="cpuCore" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('更新时间')}：</label>
					<div class="control-inline">
						<#form:input path="updateTime" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("设备ID")}', name:'deviceId', index:'a.device_id', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/rt/rtDeviceHardware/form?id='+row.id+'" class="btnList" data-title="${text("编辑硬件信息")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("总容量")}', name:'xtTotal', index:'a.xt_total', width:150, align:"left"},
		{header:'${text("已使用容量")}', name:'xtUsed', index:'a.xt_used', width:150, align:"left"},
		{header:'${text("磁盘名称")}', name:'name', index:'a.name', width:150, align:"left"},
		{header:'${text("读延迟")}', name:'rawait', index:'a.rawait', width:150, align:"left"},
		{header:'${text("负载率")}', name:'ioutil', index:'a.ioutil', width:150, align:"left"},
		{header:'${text("写延迟")}', name:'wawait', index:'a.wawait', width:150, align:"left"},
		{header:'${text("数据上报日期")}', name:'reportTime', index:'a.report_time', width:150, align:"left"},
		{header:'${text("磁盘序列号")}', name:'serial', index:'a.serial', width:150, align:"left"},
		{header:'${text("是否为加速版 ")}', name:'isCache', index:'a.is_cache', width:150, align:"left"},
		{header:'${text("磁盘类型")}', name:'type', index:'a.type', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('')}, val, '${text("未知")}', true);
		}},
		{header:'${text("磁盘温度")}', name:'temperature', index:'a.temperature', width:150, align:"left"},
		{header:'${text("磁盘总大小")}', name:'total', index:'a.total', width:150, align:"left"},
		{header:'${text("磁盘使用量")}', name:'used', index:'a.used', width:150, align:"left"},
		{header:'${text("每秒读")}', name:'ips', index:'a.ips', width:150, align:"left"},
		{header:'${text("每秒写")}', name:'ops', index:'a.ops', width:150, align:"left"},
		{header:'${text("核数")}', name:'memTotal', index:'a.mem_total', width:150, align:"left"},
		{header:'${text("内存")}', name:'cpuCore', index:'a.cpu_core', width:150, align:"left"},
		{header:'${text("更新时间")}', name:'updateTime', index:'a.update_time', width:150, align:"center"},
		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
			var actions = [];
			//<% if(hasPermi('rt:rtDeviceHardware:edit')){ %>
				actions.push('<a href="${ctx}/rt/rtDeviceHardware/form?id='+row.id+'" class="btnList" title="${text("编辑硬件信息")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/rt/rtDeviceHardware/delete?id='+row.id+'" class="btnList" title="${text("删除硬件信息")}" data-confirm="${text("确认要删除该硬件信息吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			//<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>